<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/MVC/View/views/view.edit.php');

class ViewShowExisting extends ViewEdit {
/*
	var $closedView;
	var $type = 'edit';
	var $useForSubpanel = false;
	var $useModuleQuickCreateTemplate = false;
	var $showTitle = true;
*/
	function ViewShowExisting() {
		parent::ViewEdit();
	}

	function preDisplay() {
		$metadataFile = null;

		if (file_exists('modules/' . $this->module .
			'/metadata/showexistingviewdefs.php')) {

			$metadataFile = 'modules/' . $this->module .
							'/metadata/showexistingviewdefs.php';
		}

		$this->ev = new EditView();
		$this->ev->ss =& $this->ss;

		$this->ev->defs = array();
		$this->ev->setup($this->module, $this->bean, $metadataFile);
		$this->ev->view = 'showexisting';
	}

	function display() {
		global $app_list_strings;

		parse_str($_SESSION['SHOW_EXISTING'],$_POST);
		unset($_SESSION['SHOW_EXISTING']);
		$this->ss->assign('MESSAGE_TYPE', $app_list_strings['marketing_text_type'][$this->bean->messagetype]);
		$this->ss->assign('LANGUAGE', $app_list_strings['language_dom'][$this->bean->language]);
		$this->ss->assign('OLD_MESSAGE', $this->bean->message);
		$this->ss->assign('NEW_MESSAGE', urldecode($_POST['new_text']));
		$this->ss->assign('RETURN_ACTION', $_REQUEST['return_action']);
		$this->ss->assign('RETURN_MODULE', $_REQUEST['return_module']);
		$this->ss->assign('RETURN_ID', $_REQUEST['return_id']);
		parent::display();
	}
}
?>
